{% extends  'wechat.base.html' %}
{% block title%}
wechat-js-sdk demo
{% endblock %}

{% block custom_css_js %}
{% endblock %}

{% block wechat_content%}
<h4>客户沟通记录：<b>{{customer.truename}}</b></h4>
{% if wechatlog_set %}
<table class="table table-striped table-bordered table-condensed">
{% for wechatlog in wechatlog_set %}
  <tr {% ifequal '2' wechatlog.msg_type %}class="success"{% else %}class="info"{% endifequal %}><td>{{wechatlog.get_msg_type_display}}<br/>{{wechatlog.created_at}}</td><td>{{wechatlog.content}}</td></tr>
{% endfor %}
</table>
{% endif %}
{% if customer %}
<form method="POST" name="reply-customer-form" class="form-horizontal">
<input type="hidden" name="openid" value="{{customer.openid}}"/>
{% csrf_token %}
<textarea name="content" class="form-control" rows="3"></textarea>
<button type="submit" class="btn btn-success">回复消息</button>
</form>
{% endif %}
{% endblock %}
